This is an open-label, multicenter, biomarker study designed to be hypothesis-generating in order to better understand the mechanism of action of ocrelizumab and B-cell biology in RMS or PPMS. The study will be conducted in two cohorts i.e. RMS cohort (4 arm group) and PPMS cohort (one arm group). RMS cohort: Ocrelizumab will be administered as two intravenous (IV) infusions of 300 milligrams (mg) on Days 1 and 15. Subsequent doses will be given as single 600-mg infusions at Weeks 24 and 48. Participants will be randomized in 1:1:1 ratio to receive lumbar puncture (LP) post-treatment at Week 12, 24, or 52 following the first dose of ocrelizumab in three arm groups. A fourth RMS arm with delayed treatment start (Arm 4 [control group]) will not be a part of the randomization and will be recruited separately, wherein treatment with ocrelizumab will be delayed for 12 weeks from pre-treatment baseline. PPMS cohort: Ocrelizumab 600 mg will be administered as two 300-mg IV infusions separated by 14 days at a scheduled interval of every 24 weeks. Participants will receive a LP at the start of the study before dosing with ocrelizumab and second LP at Week 52 following the first dose of ocrelizumab.